##
#
# @file
#
# @ingroup mpc55xx_config
#
# @brief Configure script of LibBSP for the MPC55xx evaluation boards.
#

AC_PREREQ([2.69])
AC_INIT([rtems-c-src-lib-libbsp-powerpc-mpc55xxevb],[_RTEMS_VERSION],[https://devel.rtems.org/newticket])
RTEMS_TOP(../../../../../..)
RTEMS_SOURCE_TOP
RTEMS_BUILD_TOP
RTEMS_BSP_LINKCMDS

RTEMS_CANONICAL_TARGET_CPU
AM_INIT_AUTOMAKE([no-define nostdinc foreign 1.12.2])
RTEMS_BSP_CONFIGURE



RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([gwlcfm],[])
RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([mpc5643l*],[])
RTEMS_BSPOPTS_SET_DATA_CACHE_ENABLED([*],[1])
RTEMS_BSPOPTS_HELP_DATA_CACHE_ENABLED

RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([gwlcfm],[])
RTEMS_BSPOPTS_SET_INSTRUCTION_CACHE_ENABLED([*],[1])
RTEMS_BSPOPTS_HELP_INSTRUCTION_CACHE_ENABLED

RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_USE_WRITE_THROUGH],[mpc5674f_ecu508*],[1])
RTEMS_BSPOPTS_SET([BSP_DATA_CACHE_USE_WRITE_THROUGH],[*],[])
RTEMS_BSPOPTS_HELP([BSP_DATA_CACHE_USE_WRITE_THROUGH],
[use write-through for data cache])

RTEMS_BSPOPTS_SET([PPC_EXC_CONFIG_USE_FIXED_HANDLER],[*],[1])
RTEMS_BSPOPTS_HELP([PPC_EXC_CONFIG_USE_FIXED_HANDLER],
[use fixed high-level exception handler])

RTEMS_BSPOPTS_SET([PPC_EXC_CONFIG_BOOKE_ONLY],[*],[1])
RTEMS_BSPOPTS_HELP([PPC_EXC_CONFIG_BOOKE_ONLY],
[only support Book E exception types])

RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5643l*],[127])
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5566*],[127])
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[mpc5674f*],[255])
RTEMS_BSPOPTS_SET([BSP_INTERRUPT_HANDLER_TABLE_SIZE],[*],[63])
RTEMS_BSPOPTS_HELP([BSP_INTERRUPT_HANDLER_TABLE_SIZE],
[defines the maximum number of interrupt handlers])

RTEMS_BSPOPTS_SET([MPC55XX_CONSOLE_MINOR],[mpc5674f_ecu508*],[2])
RTEMS_BSPOPTS_SET([MPC55XX_CONSOLE_MINOR],[*],[0])
RTEMS_BSPOPTS_HELP([MPC55XX_CONSOLE_MINOR],
[determines which serial device will be registered as /dev/console])

RTEMS_BSPOPTS_SET([BSP_DEFAULT_BAUD_RATE],[*],[115200])
RTEMS_BSPOPTS_HELP([BSP_DEFAULT_BAUD_RATE],
[default console baud])

RTEMS_BSPOPTS_SET([MPC55XX_ESCI_USE_INTERRUPTS],[*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_ESCI_USE_INTERRUPTS],
[define to zero or one to disable or enable interrupts for the eSCI devices])

RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[gwlcfm],[40000000])
RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[mpc5643l_evb*],[40000000])
RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[mpc5668g*],[25000000])
RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[mpc5674f*],[40000000])
RTEMS_BSPOPTS_SET([MPC55XX_REFERENCE_CLOCK],[*],[8000000])
RTEMS_BSPOPTS_HELP([MPC55XX_REFERENCE_CLOCK],
[Must be defined to be the external reference clock (in Hz) 
 for clock generation])

RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK],[gwlcfm],[66000000])
RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK],[mpc5668g*],[116000000])
RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK],[mpc5674f*],[264000000])
RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK],[*]     ,[128000000])
RTEMS_BSPOPTS_HELP([MPC55XX_SYSTEM_CLOCK],
[The system clock frequency in Hz.])

RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_PREDIV],[gwlcfm],[10])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_PREDIV],[mpc5668g*],[6])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_PREDIV],[mpc5674f*],[5])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_PREDIV],[*]     ,[1])
RTEMS_BSPOPTS_HELP([MPC55XX_FMPLL_PREDIV],
[Must be defined to be the PLL predivider factor for clock generation])

RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_MFD],[gwlcfm],[99])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_MFD],[mpc5668g*],[111])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_MFD],[mpc5674f*],[66])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_MFD],[*]     ,[12])
RTEMS_BSPOPTS_HELP([MPC55XX_FMPLL_MFD],
[Must be defined to be the PLL multiplication factor for clock generation])

RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_ESYNCR1_CLKCFG],[mpc5674f_rsm6],[6])
RTEMS_BSPOPTS_SET([MPC55XX_FMPLL_ESYNCR1_CLKCFG],[*],[7])
RTEMS_BSPOPTS_HELP([MPC55XX_FMPLL_ESYNCR1_CLKCFG],
[the FMPLL ESYNCR1[CLKCFG] value])

RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK_DIVIDER],[mpc5674f*],[2])
RTEMS_BSPOPTS_SET([MPC55XX_SYSTEM_CLOCK_DIVIDER],[*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_SYSTEM_CLOCK_DIVIDER],
[system clock divider])

RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[gwlcfm],[66])
RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[mpc5643l*],[])
RTEMS_BSPOPTS_SET([MPC55XX_EMIOS_PRESCALER],[*]     ,[1])
RTEMS_BSPOPTS_HELP([MPC55XX_EMIOS_PRESCALER],
[Must be defined to set the EMIOS prescaler])

RTEMS_BSPOPTS_SET([MPC55XX_NULL_POINTER_PROTECTION],[mpc5566*],[1])
RTEMS_BSPOPTS_SET([MPC55XX_NULL_POINTER_PROTECTION],[mpc5674f*],[1])
RTEMS_BSPOPTS_SET([MPC55XX_NULL_POINTER_PROTECTION],[*],[])
RTEMS_BSPOPTS_HELP([MPC55XX_NULL_POINTER_PROTECTION],
[enable NULL pointer protection])

RTEMS_BSPOPTS_SET([HAS_SMC91111],[phycore_mpc5554],[1])
RTEMS_BSPOPTS_HELP([HAS_SMC91111],
[If defined the board has the SMC91111 networking chip.])

RTEMS_BSPOPTS_SET([SMC91111_ENADDR_IS_SETUP],[phycore_mpc5554],[1])
RTEMS_BSPOPTS_HELP([SMC91111_ENADDR_IS_SETUP],
[If defined the SMC91111 chip has the ethernet address loaded at reset.])

RTEMS_BSPOPTS_SET([SMSC9218I_EDMA_RX_CHANNEL],[*],[49])
RTEMS_BSPOPTS_HELP([SMSC9218I_EDMA_RX_CHANNEL],
[receive eDMA channel for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([SMSC9218I_EDMA_TX_CHANNEL],[*],[48])
RTEMS_BSPOPTS_HELP([SMSC9218I_EDMA_TX_CHANNEL],
[transmit eDMA channel for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([SMSC9218I_BIG_ENDIAN_SUPPORT],[mpc5674f_ecu508*],[1])
RTEMS_BSPOPTS_HELP([SMSC9218I_BIG_ENDIAN_SUPPORT],
[enable big endian support for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([SMSC9218I_ENABLE_LED_OUTPUTS],[mpc5674f_ecu508*],[1])
RTEMS_BSPOPTS_HELP([SMSC9218I_ENABLE_LED_OUTPUTS],
[enable LED outputs for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([SMSC9218I_RESET_PIN],[mpc5674f_ecu508*],[433])
RTEMS_BSPOPTS_SET([SMSC9218I_RESET_PIN],[mpc5566*],[186])
RTEMS_BSPOPTS_SET([SMSC9218I_RESET_PIN],[*],[])
RTEMS_BSPOPTS_HELP([SMSC9218I_RESET_PIN],
[reset pin for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([SMSC9218I_IRQ_PIN],[mpc5674f_ecu508*],[450])
RTEMS_BSPOPTS_SET([SMSC9218I_IRQ_PIN],[mpc5566*],[193])
RTEMS_BSPOPTS_SET([SMSC9218I_IRQ_PIN],[*],[])
RTEMS_BSPOPTS_HELP([SMSC9218I_IRQ_PIN],
[IRQ pin for SMSC9218I network interface])

RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[mpc5643l*],[])
RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[mpc5668g*],[])
RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[mpc5674f*],[31])
RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_EMIOS_CHANNEL],[*],[23])
RTEMS_BSPOPTS_HELP([MPC55XX_CLOCK_EMIOS_CHANNEL],
[selects the eMIOS channel for the RTEMS system tick (the default is the last channel)])

RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[mpc5643l*],[3])
RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[mpc5668g*],[8])
RTEMS_BSPOPTS_SET([MPC55XX_CLOCK_PIT_CHANNEL],[*],[])
RTEMS_BSPOPTS_HELP([MPC55XX_CLOCK_PIT_CHANNEL],
[selects the PIT channel for the RTEMS system tick (the default is the last channel)])

RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[gwlcfm],[5516])
RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5566*],[5566])
RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5643l*],[5643])
RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5668g*],[5668])
RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[mpc5674f*],[5674])
RTEMS_BSPOPTS_SET([MPC55XX_CHIP_TYPE],[*],[5554])
RTEMS_BSPOPTS_HELP([MPC55XX_CHIP_TYPE],
[specifies the chip type in use (e.g. 5554 for MPC5554)])

RTEMS_BSPOPTS_SET([MPC55XX_CHIP_FAMILY],[*],[(MPC55XX_CHIP_TYPE / 10)])
RTEMS_BSPOPTS_HELP([MPC55XX_CHIP_FAMILY],
[specifies the chip family in use (e.g. 555 for MPC5554)])

RTEMS_BSPOPTS_SET([MPC55XX_EARLY_STACK_SIZE],[*],[1024])
RTEMS_BSPOPTS_HELP([MPC55XX_EARLY_STACK_SIZE],
[size of the early initialization stack in bytes])

RTEMS_BSPOPTS_SET([MPC55XX_BOOTFLAGS],[*],[])
RTEMS_BSPOPTS_HELP([MPC55XX_BOOTFLAGS],
[if defined, builds in bootflags above the RCHW for setup in a debugger to avoid startup MMU setup])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5674FEVB],[mpc5674fevb*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5674FEVB],[if defined, use custom settings for MPC5674FEVB board])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5566EVB],[mpc5566evb*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5566EVB],[if defined, use custom settings for MPC5566EVB board])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_GWLCFM],[gwlcfm],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_GWLCFM],[if defined, use custom settings for GWLCFM board])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5674F_ECU508],[mpc5674f_ecu508*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5674F_ECU508],[if defined, use custom settings for ECU508 board])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_MPC5674F_RSM6],[mpc5674f_rsm6],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_MPC5674F_RSM6],[if defined, use custom settings for RSM6 board])

RTEMS_BSPOPTS_SET([MPC55XX_BOARD_PHYCORE_MPC5554],[phycore_mpc5554],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_BOARD_PHYCORE_MPC5554],[if defined, use custom settings for phyCORE MPC5554 board])

RTEMS_BSPOPTS_SET([RTEMS_BSP_I2C_EEPROM_DEVICE_NAME],[gwlcfm],['"eeprom"'])
RTEMS_BSPOPTS_HELP([RTEMS_BSP_I2C_EEPROM_DEVICE_NAME],[EEPROM name for LibI2C])
RTEMS_BSPOPTS_SET([RTEMS_BSP_I2C_EEPROM_DEVICE_PATH],[gwlcfm],['"/dev/i2c1.eeprom"'])
RTEMS_BSPOPTS_HELP([RTEMS_BSP_I2C_EEPROM_DEVICE_PATH],[EEPROM device file path])

RTEMS_BSPOPTS_SET([MPC55XX_NEEDS_LOW_LEVEL_INIT],[mpc5674f_*app],[])
RTEMS_BSPOPTS_SET([MPC55XX_NEEDS_LOW_LEVEL_INIT],[*],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_NEEDS_LOW_LEVEL_INIT],[if defined, do low level initialization])

RTEMS_BSPOPTS_SET([MPC55XX_ENABLE_START_PROLOGUE],[mpc5674f_rsm6],[1])
RTEMS_BSPOPTS_HELP([MPC55XX_ENABLE_START_PROLOGUE],[if defined, enable start prologue])

AC_DEFINE(__ppc_generic, 1, [PowerPC model option])

AC_CONFIG_FILES([Makefile])

RTEMS_BSP_CLEANUP_OPTIONS

RTEMS_PPC_EXCEPTIONS

AC_OUTPUT
